[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 float                   Single-Precision Floating-Point Data Type

    The float type declares an object to be of "single-precision"
    floating-point type.  The size (and representation) of a float object
    is implementation-defined.  A float is the same or less in size than
    a double.

      Notes:    In Turbo C++, the size of a float object is four bytes.
                The range of values is approximately 3.4E-38 to 3.4E+38.

                All floating constants have type double. You can coerce a
                floating constant to be of type float by adding an F
                suffix to the constant.

                Since all floating-point arithmetic is performed in
                double-precision, and all float expressions used as
                function arguments are promoted to type double, it might
                appear you would have little use for type float.  Floats,
                however, require only four storage bytes, whereas doubles
                require eight.  The decision between float and double is
                one of space versus run-time conversion cost.

   -------------------------------- Example ---------------------------------

           float value = 1.234;
           float f1 = 1.234E-24;

           value = (float) 123;


See Also: Types double long
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson